/** ****************************************************************************
 * CopyRight (C) 2012 Sharadendu Sinha.
 * Licensing : FreeBSD 
 *
 * @(#) $Id$
 */
package com.sps.signalling;

import java.util.concurrent.Executor;

import com.sps.signalling.InvokableConnection.Type;
import com.sps.signalling.Slot.SlotHandler;

/**
 * This is the base interface for all {@link SlotProvider}s or classes that are
 * exposing {@link Slot}s
 * 
 * @version 1.1
 * @author sharadendu
 */
public interface SlotProvider
	extends InvokableProvider
{
	/**
	 * This method allows {@link SlotHandler} execution in different or same
	 * thread based on the {@link Executor} that is returned. The default
	 * {@link Executor} provided by the {@link SignallingEntity} invokes the
	 * {@link SlotHandler} in the same thread. However if the invocation is to
	 * be done on separate thread, the sub classes of {@link SignallingEntity}
	 * should override
	 * {@link SlotProvider#getExecutor(com.sps.signalling.InvokableConnection.Type)}
	 * 
	 * @param type {@link Type} it is based on this param that the
	 *            {@link SlotProvider} is to decide which {@link Executor} to
	 *            return
	 * @return {@link Executor}
	 */
	Executor getExecutor(final InvokableConnection.Type type);
}
